package com.example.springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

//@Component
@Slf4j
@Aspect
public class AspectDemo2 {
    @Before("com.example.springaop.aspect.AspectDemo1.pt()")
    public void beforeTest() {
        log.info("AspectDemo2 before 开始执行...");
    }

    @Around("com.example.springaop.aspect.AspectDemo1.pt()")
    public Object aroundTest(ProceedingJoinPoint point) throws Throwable {
        log.info("AspectDemo2 around 开始执行...");

        Object result = point.proceed();

        log.info("AspectDemo2 around 结束执行...");
        return result;


    }
}
